<?php
require_once 'a_config.php';
//登陆状态控制
//开启session
if(!session_id()){
    session_start();
}
//获取后台管理系统session_key

$session_key=$A_CONFIG['project_pre'].'admin_backstage';

$admin_status=$session_key.'_status';
$admin_name=$session_key.'_name';
//session中储存   登陆状态  用户名
if(!isset($_SESSION[$admin_status])
    || $_SESSION[$admin_status]!="loginSuccess"
    || !isset($_SESSION[$admin_name])
){
    session_write_close();
    //没有登录用户，跳转登录页面
    header("location:login.php");
    exit();
}else{
    $login_username = $_SESSION[$admin_name];
    $key = $A_CONFIG['api_key'];
    $unixtime = time();
    $token = md5($key . $unixtime);
    $token_info="var token='{$token}',unixtime='{$unixtime}'";
}


?>